package st.utils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;


public class ReadTags {


	public static String[] readTags(String filename)
	{
		ArrayList<String> wordList = new ArrayList<String>();
		BufferedReader br = null;
		try 
		{
			br = new BufferedReader(new FileReader(filename));

			String word;

			while ((word = br.readLine()) != null)
			{
				wordList.add(word);
			}
		} 
		catch (IOException exc)
		{
			exc.printStackTrace();
		} 
		finally 
		{
			try 
			{
				br.close();
			} 
			catch(IOException exc) 
			{
				exc.printStackTrace();
			}
		}
		
		String[] tags = new String[wordList.size()];
		for(int i=0; i<wordList.size(); i++)
		{
			tags[i] = wordList.get(i).split(" ")[0];
		}
		return tags;
	}
	
	
}
